package com.qersoft.entity;


import lombok.Data;
import org.springframework.http.HttpStatus;

@Data
public class toBankMSG {
    private Integer code;
    private String message;
    private String data;

    public toBankMSG(Integer code, String message, String data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static toBankMSG message(String data)
    {
        if (data.equals("success")) {
            return new toBankMSG(HttpStatus.OK.value(), "success:错题库更新", data);
        } else{
            return new toBankMSG(HttpStatus.INTERNAL_SERVER_ERROR.value(), "error:查找不到用户ID，错题库更新失败", data);
        }
    }

}
